package com.spb.dubbo.cn.controller;/**
 * @Author: GaoXiaoPeng
 * @Description:
 * @Date: Created in 下午3:34 2018/4/14
 */

import com.spb.dubbo.cn.domain.MLove;
import com.spb.dubbo.cn.gxpconsumer.MyConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *@ClassName MyController
 *@Description TODO
 *@Author youli
 *@Date 2018/4/14 下午3:34
 **/
@Controller
public class MyController {
    @Autowired
    MyConsumerService myConsumerService;

    @RequestMapping("/dubbotest")
//    @ResponseBody
    public String getDubboInfo(MLove something){
        System.out.print(something);
        String mark=myConsumerService.doSomethingByDubbo(something.getWants());
        if("可以".equals(mark)){
            return "forward:/startml";
        }
        return mark;
    }
    @RequestMapping("/startml")
    @ResponseBody
    public MLove makel(MLove wm){
        return wm;
    }
}
